import request from '@/utils/request'

export const getArticles = params => request.get('/interview/query', { params })

export const getDetail = id => request.get('/interview/show', { params: { id } })

export const updateLike = (id) => request.post('/interview/opt', { id, optType: 1 })

export const updateCollect = (id) => request.post('/interview/opt', { id, optType: 2 })

export const getArticlesCollect = (obj) => request.get('/interview/opt/list', {
  params: {
    page: obj.page, // 当前页
    pageSize: 5, // 可选
    optType: 2 // 表示收藏
  }
})

export const getArticlesLike = (obj) => request.get('/interview/opt/list', {
  params: {
    page: obj.page, // 当前页
    pageSize: 5, // 可选
    optType: 1 // 表示收藏
  }
})
